package com.javafactroy.kunlong.data.service;

import com.javafactroy.kunlong.data.dao.mysql.SysAppApiMapper;
import com.javafactroy.kunlong.data.entity.SysAppApiEntity;
import com.javafactroy.kunlong.data.dto.SysAppApiDto;
import com.javafactroy.kunlong.base.dto.TQueryParam;
import com.javafactroy.kunlong.base.model.ReturnPageInfo;

import org.apache.ibatis.annotations.Param;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author raymond.lei@163.com
 * @date 2023-12-02 12:14:00
 */
@Slf4j
@Service
public class SysAppApiService extends ApiService<SysAppApiDto, SysAppApiEntity, SysAppApiMapper> {

    public SysAppApiService() {
        init();

    }

    void init() {
        iquerySome = (SysAppApiDto dto) -> {
        };

        iquerySomeList = (List<SysAppApiDto> list) -> {
            list.forEach(i -> iquerySome.querySome(i));
        };
    }

    public ReturnPageInfo<SysAppApiDto> queryParam(@Param("queryParam") TQueryParam<SysAppApiDto> queryParam) {
        if (queryParam.getParam() == null) {
            queryParam.setParam(new SysAppApiDto());
        }

        return super.queryParam(queryParam);

    }

//    public int save(SysAppApiDto entity) {
//        if (entity.getAppId() == null) {
//            return super.insert(entity);
//        }
//        return super.update(entity);
//    }

}
